package com.jxaummd.mushroom.core.app.account;


import com.jxaummd.mushroom.core.app.application.ConfigKeys;
import com.jxaummd.mushroom.core.app.application.University;
import com.jxaummd.mushroom.core.util.tool.storage.UniversityPreference;

/**
 * Created by 傅令杰 on 2017/4/22
 */

public class AccountManager {

    private static String APPHOST = University.getConfiguration(ConfigKeys.API_HOST);


    private enum SignTag {
        SIGN_TAG
    }

    //保存用户登录状态，登录后调用
    public static void setSignState(boolean state) {
        UniversityPreference.setAppFlag(SignTag.SIGN_TAG.name(), state);
    }

    public static boolean isSignIn() {
        return UniversityPreference.getAppFlag(SignTag.SIGN_TAG.name());
    }

    public static void checkAccount(IUserChecker checker) {
        if (isSignIn()) {
            checker.onSignIn();
        } else {
            checker.onNotSignIn();
        }
    }


}
